// hckj_gwxcx/pages/serveDetail/serveDetail.js
var app = getApp();
var WxParse = require('../../we7/pages/wxParse/wxParse.js');

Page({

    /**
     * 页面的初始数据
     */
    data: {
        title: '',
        detail: '',
        id: '',
        caseDetail: [],
        content: []

    },


    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        var that = this;
        console.log(options)
        app.util.request({
            'url': 'entry/wxapp/app',
            data: {
                m: 'llt_xappsc',
                id: options.id
            },
            'cachetime': '30',
            success: function(res) {

                let detail = res.data.data.detail;
                let title = res.data.data.title;
                console.log(detail)
                WxParse.wxParse('content', 'html', detail, that, 5);
                wx.setNavigationBarTitle({
                    title: title //页面标题为路由参数
                })
                that.setData({
                    title: title,
                    detail: detail,
                    id: options.id
                })
            }
        });
    },
    onShareAppMessage: function() {
        title: '客单'
        path: 'pages/detail/detail?id=' + this.data.id
    },

})